import os
import glob
Import('env')
Import('conf')

# Sources
sources = []
patterns = Split('*.cs \
                  */*.cs \
                  */*/*.cs \
                  ../base/Backend/Protocols/Nmdc/*.cs \
                  ../AssemblyInfo.cs')

for pattern in patterns:
	for source in glob.glob(pattern):
		sources.append(source)

# Build

cscflags = Split('-unsafe')

localEnv = env.Copy()
localEnv.Append(GREF = Split('System.Web.dll \
                              System.Configuration.dll \
                              ICSharpCode.SharpZipLib.dll'),
                CSCFLAGS = cscflags)

localEnv.CLILibrary('#bin/DCSharp.Base.dll', sources)


# Install

lib_dir = env['DESTDIR'] + os.sep + os.path.join(env['LIBDIR'], 'dcsharp')

env.Alias("install", env.InstallProgram(lib_dir, '#bin/DCSharp.Base.dll'))
env.Alias("install", env.InstallData(lib_dir, '#bin/DCSharp.Base.dll.config'))

